package com.itheima.printstream;

import java.io.FileOutputStream;
import java.io.PrintStream;
import java.io.PrintWriter;

public class Test1 {

    public static void main(String[] args) {

        //打印流
        try (
                //PrintStream ps = new PrintStream("io\\src\\ps.txt")     //字节流
                PrintStream ps = new PrintStream(new FileOutputStream("io\\src\\ps.txt", true));
                //PrintWriter ps = new PrintWriter("io\\src\\ps.txt")   //字符流
        ) {

            ps.println(97);     //写什么打印什么
            ps.println(3.14);
            ps.println(true);
            ps.println('a');
            ps.println("hello");
            ps.println("海域");

        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
